package lion.framework.core.db.paging;

import java.util.HashMap;
import java.util.Map;

/**
 * 数据库 sql分页工厂类
 *
 * <pre>
 * time   2013 2013-4-24 上午11:29:24
 * mail   hl_0074@sina.com
 * </pre>
 *
 * @author lion
 */
public class SQLPagingFactory {

	public static String paging(String type, String sql, int start, int size) {

		ISQLPaging paging = pagingMap.get(type);

		if (paging == null) { return sql; }
		return paging.paging(sql, start, size);
	}

	public static void regist(String type, ISQLPaging paging) {

		pagingMap.put(type, paging);
	}

	private static Map<String, ISQLPaging> pagingMap = new HashMap<>();
}
